// pages/orderDetails/orderDetails.js
var app = getApp(),
  fn = app.fn;
Page({
  data: {
    ordeDetails: [],
    key :'',
    postStatus :true,
    checkText : '展开'
  },

  bannerClick: function (e) {

    var id = e.currentTarget.dataset.id;
    var url = '../';


 
        url += 'buyCart/buyCart';
      
   

    url += '?id=' + id;
    wx.navigateTo({ url: url })
  },
  onLoad: function (options) {
   
    this.getInitData(options.id)
  },

  getInitData: function (callBack) {
    var that = this;
   
    fn.apiData({
      url: 'order.php',
      data: { order_id: callBack, act: 'order_detail', user_id: app.globalData.uid},
      success: function (res) {
        if (res.data.code==0) {
          that.setData({ 'ordeDetails': res.data.data });
          for (var key  in res.data.data.kuaidi_list){
            
            that.setData({
              key : key
            })
            console.log(JSON.stringify(that.data.ordeDetails.kuaidi_list[key].data));
          }
          wx.hideToast();
        }
      }
    });
  },
  //查看配送信息
  checkShippingInfo :function(){
    let that = this;
    this.setData({
      postStatus : !that.data.postStatus,
      checkText: that.data.postStatus ? '收起' :'展开'
    });
  }
})